package com.qfedu.aunt.commons.mapper;

import com.qfedu.aunt.commons.dto.PermDTO;
import com.qfedu.aunt.commons.pojo.Perm;
import com.qfedu.aunt.commons.pojo.Role;
import com.qfedu.aunt.commons.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xiaobobo
 * @since 2022-10-31
 */
@Repository
public interface UserMapper extends BaseMapper<User> {
    /**
     * 通过用户id查询角色
     * @param id
     * @return
     */
    List<Role> findRolesByUserId(String id);

    /**
     * 通过用户id查询权限
     * @param id
     * @return
     */
    List<Perm> findPermsByUserId(String id);

    /**
     * 通过用户id 查询我们的菜单信息(这里不查询权限)
     * @param userId
     * @return
     */
    List<PermDTO> findMenuByUserId(String userId);

}
